﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace Universitet_Fakyltet
{
    class Student
    {
        public string lastNameOfStudent;
        public string nameOfStudent;
        public DateTime birthdayOfStudent;
        public int[] marks = new int[10];
        static int studentsNumber = 0;

        public void FillValuesOfStudents()
        {
            nameOfStudent = "Vasya" + Student.studentsNumber;
            lastNameOfStudent = "Pupkin";
            Random rnd = new Random;
            birthdayOfStudent = new DateTime(rnd.Next(1990, 2015), rnd.Next(1,13), rnd.Next(1, 28));
            //Console.WriteLine("Введите фамилию студента: ");
            //lastNameOfStudent = Console.ReadLine();
            //Console.WriteLine("Введите имя студента: ");
            //nameOfStudent = Console.ReadLine();
            //Console.WriteLine("Введите дату рождения студента: ");
            //birthdayOfStudent = Console.ReadLine();
            //Console.WriteLine("Введите оценки студента: ");
            marks = CreateArrayWithRandom(10, 0, 150);
        }

        public void ShowInfoAboutStudents()
        {
            Console.WriteLine("Фамилия {0}, имя {1}, дата рождения {2} студента", lastNameOfStudent, nameOfStudent, birthdayOfStudent.ToString("dd/mm/yyyy"));
        }

        public double FindMiddleMarkOfStudent()
        {
            return marks.Average();
        }

        public int[] CreateArrayWithRandom(int sizei, int minLimit, int maxLimit)
        {
            int[] array = new int[sizei];
            Random rnd = new Random();
            for (int i = 0; i < sizei; i++)
            {
                array[i] = rnd.Next(minLimit, maxLimit + 1);
            }
            return array;

        }
    }
}
